<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Admin\AuthController;
use App\Http\Controllers\Admin\MenusController;
use App\Http\Controllers\Admin\UploadController;
use App\Http\Controllers\Admin\PositionCategoryController;
use App\Http\Controllers\Admin\BusinessController;
use App\Http\Controllers\Admin\AdminController;
use App\Http\Controllers\Admin\JobController;
use App\Http\Controllers\Admin\RoleController;
use App\Http\Controllers\Admin\NotesController;
use App\Http\Controllers\Admin\PushLinkFlowController;
use App\Http\Controllers\Admin\TestESController;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/


Route::prefix('/admin')->group(function () {
    Route::post('/login', [AuthController::class, 'login']);
    # 自动匹配
    Route::post('/job/auto-match', [JobController::class, 'autoMatch']);
    Route::get('/es', [TestESController::class, 'test']);

    # 任务 动态推送 修改用户标识
    Route::get('/link-push', [PushLinkFlowController::class, 'createUsers']);

    # 任务 创建用户订单
    Route::get('/link-push-order', [PushLinkFlowController::class, 'createUsersOrders']);

    # 一次性推送创建用户
    Route::get('/once-push-user', [PushLinkFlowController::class, 'disposablePush']);


    # 暂时
    Route::get('/exp', [NotesController::class, 'exportData']);

    Route::group(['middleware' => 'admin.auth'], function () {
        Route::get('/getmenu', [MenusController::class, 'menusByAdmin']);
        Route::get('/getpower', [MenusController::class, 'powers']);
        Route::get('/u-info', [AuthController::class, 'info']);
        Route::post('/logout', [AuthController::class, 'logout']);

        # 获取token
        Route::post('/qn-token/{type}', [UploadController::class, 'qnToken']);
        # 上传资源
        Route::post('/qn-upload', [UploadController::class, 'upload']);

        # 公共参数
        Route::get('/comn', [UploadController::class, 'commonDt']);

        # 获取城市
        Route::get('/city', [UploadController::class, 'getCity']);

        # 分类
        Route::get('/category/list', [PositionCategoryController::class, 'list']);
        Route::post('/category/add', [PositionCategoryController::class, 'createCategory']);
        Route::get('/category/dtl/{id}', [PositionCategoryController::class, 'dtlCategory']);
        Route::post('/category/del/{id}', [PositionCategoryController::class, 'delCategory']);

        # 企业
        Route::get('/bsn/list', [BusinessController::class, 'list']);
        Route::post('/bsn/add', [BusinessController::class, 'createBusiness']);
        Route::post('/bsn/del/{id}', [BusinessController::class, 'delBusiness']);
        Route::get('/bsn/dtl/{id}', [BusinessController::class, 'dtlBusiness']);
        Route::post('/bsn/st/{id}', [BusinessController::class, 'stBusiness']);
        # 岗位
        Route::get('/job/list', [JobController::class, 'list']);
        Route::post('/job/add', [JobController::class, 'createJob']);
        Route::post('/job/del/{id}', [JobController::class, 'delJob']);
        Route::get('/job/dtl/{id}', [JobController::class, 'dtlJob']);
        Route::post('/job/st/{id}', [JobController::class, 'stJob']);

        # 角色
        Route::get('/role/list', [RoleController::class, 'list']);
        Route::post('/role/add', [RoleController::class, 'createRole']);
        Route::post('/role/del/{id}', [RoleController::class, 'delRole']);
        Route::get('/role/dtl/{id}', [RoleController::class, 'dtlRole']);

        # 角色权限
        Route::get('/role/bind/dtl/{id}', [RoleController::class, 'bindRoleDtl']);
        Route::post('/role/bind', [RoleController::class, 'bindRole']);
        # 用户角色
        Route::get('user/role/bind/dtl/{id}', [RoleController::class, 'bindAdminRoleDtl']);
        Route::post('user/role/bind', [RoleController::class, 'bindAdminRole']);

        # 管理员
        Route::get('/admin/list', [AdminController::class, 'list']);
        Route::post('/admin/add', [AdminController::class, 'createAdmin']);
        Route::post('/admin/del/{id}', [AdminController::class, 'delAdmin']);
        Route::get('/admin/dtl/{id}', [AdminController::class, 'dtlAdmin']);

        # 匹配结果
        Route::post('/job/mate-res/{id}', [JobController::class, 'mateResJob']);

        # 匹配结果 状态修改
        Route::post('/job/mate-st/{id}', [JobController::class, 'mateResJobSt']);

        # 简历列表
        Route::get('/notes', [NotesController::class, 'notesList']);

        # 简历详情
        Route::get('/notes/dtl', [JobController::class, 'notesDtByMobile']);

        # 创建简历
        Route::post('/c-resume', [NotesController::class, 'createResume']);

        # 删除简历
        Route::post('/resume/del/{id}', [NotesController::class, 'delResume']);

        # 简历下载
        Route::post('/notes/down/{id}', [JobController::class, 'notesDownload']);

        # 邀请面试
        Route::post('/invite/interview', [JobController::class, 'inviteInterview']);
    });
});


